package com.sl.spring.intergration.rabbitmq.direct;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitMQConfig {
	
	@Bean
	public Queue helloQueue() {
		return new Queue("hello");
	}
	
	@Bean
    public DirectExchange directExchange() {
        return new DirectExchange("directExchange");
    }
	
	@Bean
	public Binding bindExchange(Queue helloQueue, DirectExchange directExchange){
		return BindingBuilder.bind(helloQueue).to(directExchange).with("blank");
	}
}
